<template>
	<div id="header">
		<div class="container">
			<img src=" ../../static/img/top.png" class="img-responsive logo pc-bg" />
		</div>
		<!--pc-->
		<nav class="pc-nav">
			<ul class="list-inline container">
				<li v-for="item in navList" @click="selected(item.mca)">
					<a class="text-center">{{item.name}}</a>
					<ul class="second-nav list-unstyled">
						<li  v-for="item1 in item._data"  @click.stop="selected(item1.mca)">
							<span class="text-center">{{item1.name}}</span>
						</li>
					</ul>
				</li>
			</ul>
		</nav>
		<!--mobail-->
		<div class="m-logo">
			<img src="../../static/img/m-logo.png" class="m-logo-pic m-bg" />
			<img src="../../static/img/m-nav.png" class="m-nav-btn" data="close"/>			
		</div>
		<div class="m-logo-contant">
			<span>互联网学院</span>
			<span>|</span>
			<span>招生在线</span>
		</div>
		<nav class="m-nav">
			<ul class="list-unstyled">
				<li class="first-nav" v-for="item in navList" @click="selected(item.mca,item.name)">
					<i class="iconfont" :class="item.ico"></i>
					<span>{{item.name}}</span>
					<ul class="list-unstyled m-second-nav" :class="{active: activeName == item.name }">
						<li v-for="item1 in item._data"><span>{{item1.name}}</span></li>
						
					</ul>
				</li>
			</ul>
		</nav>
	</div>
</template>

<script>
export default {
	data(){
        return{
        	// isShow: false,
        	navList: [],
        	// gameName:'',
            activeName: '', 
            status: false,
            // uri: ''
        }
    },
    created:function(){
    	var _self = this;
    	var url="http://hh.c1903.com/index/api/menu"; 
    	
		this.$http.post(url,{token:'xueyuanyi',code:'1a11c6a0e49a916429c1719fa8d587e2'}).then((res)=>{
			_self.navList = res.data;
			_self.navList = _self.navList[1]._data;
	　　}).catch((err)=>{
	　　　　console.log(err);
	　　});
    	
    },
    mounted() {
    	
    },
    watch: {
    	$route (to, from) {
    		this.uri = this.$route.path;
    	}
    },
	methods: {
	    selected: function(url,name) {
	      this.activeName = name;
	      this.$router.push({ path: url });
	      
	    }
	 }
	}
</script>

<style>
</style>